package cn.lcc.ymcc.domain;


import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
 * <p>
 * 
 * </p>
 *
 * @author lcc
 * @since 2022-12-02
 */
@TableName("t_department")
public class Department extends Model<Department> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 部门编号
     */
    @NotNull(message = "部门编号不能为空")
    private String sn;
    /**
     * 部门名称
     */
    @NotNull(message = "部门名称不能为空")
    private String name;
    /**
     * 部门的上级分类层级id
     */
    @TableField("dir_path")
    private String dirPath;
    /**
     * 部门状态，0正常，1禁用
     */
    @Min(value = -1,message = "部门状态不合法")
    @Max(value = 1,message = "部门状态不合法")
    private Integer state;
    /**
     * 部门管理员，关联Employee表id
     */
    @TableField("manager_id")
    private Long managerId;
    /**
     * 上级部门
     */
    @TableField("parent_id")
    private Long parentId;
    /**
     * 部门所属机构(租户)
     */
    @TableField("tenant_id")
    private Long tenantId;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getName() {
        return name;
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }
}
